package com.banmao.struts2;

import com.alibaba.fastjson.JSON;
import com.opensymphony.xwork2.ActionSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;

public class UploadAction extends ActionSupport {

    private static final Logger logger = LoggerFactory.getLogger(UploadAction.class);

    private static final long serialVersionUID = 1L;


    private File upload;
    private String uploadContentType;
    private String uploadFileName;


    public File getUpload() {
        return upload;
    }

    public void setUpload(File upload) {
        this.upload = upload;
    }

    public String getUploadContentType() {
        return uploadContentType;
    }

    public void setUploadContentType(String uploadContentType) {
        this.uploadContentType = uploadContentType;
    }

    public String getUploadFileName() {
        return uploadFileName;
    }

    public void setUploadFileName(String uploadFileName) {
        this.uploadFileName = uploadFileName;
    }


    public String doUpload() {

        logger.info("============ enter singal upload");

        // EntityLogic entityLogic = ApplicationContext.getEntityLogic();
        // ConsoleUser consoleUser = new ConsoleUser();
        // Entity entity = entityLogic.findEntity(ConsoleUser.class, 1);

        logger.info("ConsoleUser:{}", JSON.toJSONString(null));

        return SUCCESS;
    }

}

